/*************************************************************************
	> File Name: P5726.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-14 10:00:51
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    sort(arr.begin(), arr.end());
    arr.pop_back();
    int sum = 0;
    for (int i = 1; i < arr.size(); i++) {
        sum += arr[i];
    }
    printf("%.2lf\n", sum * 1.0 / (n - 2));
    return 0;
}
